<?php
namespace app\home\controller;
use app\home\controller\Com;
use think\Session;
use think\Db;

class Album extends Com
{
    public function index()
    {   
        $id=Session::get('user.id');
       
        $data=Db::name('album')->join('user','user.id= zone_album.user_id')->field('zone_album.*,user.user_number')->order('zone_album.id desc')->where("zone_album.user_id=$id")->paginate(3);
        // var_dump($data);die();
        if (empty($data)) {
            
        }else{
            foreach ($data as $val) {
                // echo 1;die();
                var_dump($val.id);die();
                $da[
                    "album_img.album_id"=>"$val['id']";
                ];
                $link=Db::name("album_img")->where($da)->find();
                var_dump($link);
                die;
            }
            $this->assign('data',$data);
        }
        return view();
    }
    public function info()
    {
        return view('info');
    }
}
